x86/AMD: flush TLB after ucode update
authorJan Beulich <jbeulich@suse.com>
Fri, 1 Feb 2019 10:35:41 +0000 (11:35 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 1 Feb 2019 10:35:41 +0000 (11:35 +0100)
commit514dccd049f8338495b6c992b9c6a1ec2ece2932
tree67218786f2689c3df8295d3c54c6b56e6ce36ad1
parente202feb7131e66ed9186ad8766c9582502c98998
x86/AMD: flush TLB after ucode update

The increased number of messages (spec_ctrl.c:print_details()) within a
certain time window made me notice some slowness of boot time screen
output. Experimentally I've narrowed the time window to be from
immediately after the early ucode update on the BSP to the PAT write in
cpu_init(), which upon further investigation has an effect because of
the full TLB flush that's implied by that write.

For that reason, as a workaround, flush the TLB of the mapping of the
page that holds the blob. Note that flushing just a single page is
sufficient: As per verify_patch_size() patch size can't exceed 4k, and
the way xmalloc() works the blob can't be crossing a page boundary.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Brian Woods <brian.woods@amd.com>
master commit: f19a199281a23725beb73bef61eb8964d8e225ce
master date: 2019-01-28 17:40:39 +0100
xen/arch/x86/microcode_amd.c